﻿@using ModelToDto


@model RoleMenuDTO
<div class="div-table">

    <h3>@Model.RoleName 搭配菜单</h3>
    @using (Html.BeginForm("RoleMenuAdd", "Role", FormMethod.Post, new { @class = "row g-3" }))
    {
        <p></p>
        @Html.HiddenFor(c => c.RoleID)
        <table class="table table-hover">
            <tr>
                <td width="20%">
                    一级菜单
                </td>
                <td width="80%">
                    二级菜单
                </td>

            </tr>
            @foreach (var item in Model.MenueListItems)
            {
                <tr>
                    <td width="20%">
                        <div style="height:40px;width:150px;float:left;padding:10px">
                            @Html.CheckBox($"menueId_{item.Meu_Id}", item.IsCheck)
                            @item.Meu_Name
                        </div>
                    </td>
                    <td width="80%">
                        @foreach (var child in item.ChildList)
                        {
                            <div style="height:30px;width:150px;float:left;padding:10px">
                                @child.Meu_Name
                                @Html.CheckBox($"menueId_{child.Meu_Id}", child.IsCheck)
                            </div>
                        }
                    </td>

                </tr>
            }
        </table>
        <div class="col-12">
            <button type="submit" class="btn btn-primary">提交</button>
        </div>
    }
</div>
